package org.yzz.auth.lisenner;


import org.yzz.auth.service.IPermissionScanService;
import javax.annotation.Resource;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener // 交给 Spring 管理
public class PermissionListener implements ServletContextListener {
    @Resource
    private IPermissionScanService permissionScanService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("监听到程序启动了.....");
        System.out.println("===========开始扫描=============");
        permissionScanService.scan();
        System.out.println("===========结束扫描=============");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
